<template>
<div>

  <!--  头部导航栏  -->
  <div>
    <el-menu
        :default-active="this.$route.path"
        class="el-menu-demo"
        mode="horizontal"
        @select="handleSelect"
        router
        background-color="#fff"
        text-color="#333"
        active-text-color="#0084ff"
        style="flex:1"
    >
      <el-menu-item style="padding:0 10px" v-for="(item, i) in navList" :key="i" :index="item.name">
        <template slot="title">
          <span> {{ item.navItem }}</span>
        </template>
      </el-menu-item>
    </el-menu>
  </div>


<!--  找回密码表单  -->
  <div>
    <el-form :model="form" :rules="rules" ref="form" label-width="80px" class="retrieve-box">
      <h3>重置密码</h3>
      <el-form-item label="用户信息" prop="ID">
        <el-input v-model="form.ID" placeholder="请输入邮箱地址">
        </el-input>
      </el-form-item>
      <el-form-item label="验证码" prop="code">
        <div class="get-code-box">
          <el-input v-model="form.code" placeholder="请输入验证码"></el-input>
          <span @click="Getting()">获取验证码</span>
        </div>
      </el-form-item>
      <el-form-item label="重置密码" prop="newpassword">
        <el-input v-model="form.newpassword"  placeholder="请输入新密码"></el-input>
      </el-form-item>
      <el-form-item label="确认密码" prop="pin">
        <el-input v-model="form.pin"  placeholder="请再次输入密码"></el-input>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="Resetting('form')">重置密码</el-button>

      </el-form-item>
    </el-form>
  </div>

</div>
</template>
<script>
export default {
  name: "retrieve",
  data() {
    return {
      aa:'https://element.eleme.io',

      // 导航栏数据
      navList:[
        {name:'/index', navItem:'系统首页'},
        {name:'/advice',navItem:'意见反馈'},
        {name:'/login', navItem:'系统登录'},
        {name:'/register',navItem:'系统注册'}
      ],

      form: {
        ID:'',
        password: '',
        repassword: '',
        pin:'',
      },
      rules: {
        ID: [
          {required: true, message: '请输入用户名', trigger: 'blur'}
        ],
        code: [
          {required: true, message: '请输入验证码', trigger: 'blur'}
        ],
        newpassword: [
          {required: true, message: '请输入重置密码', trigger: 'blur'}
        ],
        pin: [
          {required: true, message: '请输入重置密码', trigger: 'blur'}
        ],
      }
    }
  },

  methods: {
    Getting(){
      alert(" ");
    },
    handleSelect(){},
    jump(){
      window.location.assign(this.aa)
    },

    Resetting(){
      this.$router.push({path:'/login'})
    },
  }
}

</script>

<style scoped lang="scss">
.retrieve-box {

  width: 4.5rem;

  margin: 1.5rem auto;

  border: aqua;

  padding: 0.4rem;

  border-radius: 0.1rem;

  box-shadow: 0 0 0.3rem #2c3e50;
  .el-menu {
    display: flex;
    flex-wrap: nowrap;
  }
  .get-code-box {
    display: flex;
    span {
      //padding: 5px 10px;
      background-color: gainsboro;
      border-radius: 8px;
      white-space: nowrap;
      line-height:40px;
      padding: 0 10px;
      margin-left: 8px;
      display: inline-block;
      //display: block;
      cursor: pointer;
    }
  }
}

</style>